import {getWidth } from '&helpers/tools/index';
import {produce } from 'immer';

export const models = {
  name: 'userEquipment',
  model: {
    state: {
      iphone: getWidth() < 768
    },
    reducers: {
      setState(state, payLoad) {
        return produce(state, draft => {
          draft.iphone = payLoad
        })
        // return {...state, iphone: payLoad}
      }
    },
    effects: dispatch => {
      return {
        changeEquipment(params) {
          dispatch.userEquipment.setState(params)
        }
      }
    }
  }
}
